<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8"/>
    <title>FOREST物业管理系统后台</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta content="A fully featured admin theme which can be used to build CRM, CMS, etc." name="description"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
    <!-- App favicon -->
    <link rel="shortcut icon" href="images/favicon.ico">
    <link rel="stylesheet" href="webjars/sweetalert2/10.10.0/dist/sweetalert2.min.css">
    <script src="webjars/sweetalert2/10.10.0/dist/sweetalert2.min.js"></script>
    <!-- third party css -->
    <link href="libs/datatables/dataTables.bootstrap4.min.css" rel="stylesheet" type="text/css"/>
    <link href="libs/datatables/responsive.bootstrap4.min.css" rel="stylesheet" type="text/css"/>
    <link href="libs/datatables/buttons.bootstrap4.min.css" rel="stylesheet" type="text/css"/>
    <link href="libs/datatables/select.bootstrap4.min.css" rel="stylesheet" type="text/css"/>
    <script src="js/username.js"></script>
    <!-- App css -->
    <link href="css/bootstrap.min.css" rel="stylesheet" type="text/css"/>
    <link href="css/icons.min.css" rel="stylesheet" type="text/css"/>
    <link href="css/app.min.css" rel="stylesheet" type="text/css"/>
    <script src="js/jquery-3.5.1.min.js"></script>
    <style type="text/css">
        #eeeee {
            text-align: center;
        }

        #eeeee input {
            border: 1px #0d0f13 solid;
            margin-left: 40px;
            width: 70px;
            height: 40px;
            color: #4e555b;
            line-height: normal;
            text-align: center;
        }

        #selected {
            width: 200px;
            height: 40px;
            box-shadow: #5a6268;

        }

        #sbody {

        }


    </style>
    <link rel="stylesheet" href="css/pop.css">
</head>

<body>

<!-- Begin page -->
<div id="wrapper">

    <!-- Topbar Start -->
    <div class="navbar-custom">
        <ul class="list-unstyled topnav-menu float-right mb-0">

            <li class="dropdown d-none d-lg-block">
                <a class="nav-link dropdown-toggle mr-0 waves-effect waves-light" data-toggle="dropdown" href="#"
                   role="button" aria-haspopup="false" aria-expanded="false">
                    <img src="images/flags/us.jpg" alt="user-image" class="mr-1" height="12"> <span
                        class="align-middle">English <i class="mdi mdi-chevron-down"></i> </span>
                </a>
                <div class="dropdown-menu dropdown-menu-right">

                    <!-- item-->
                    <a href="javascript:void(0);" class="dropdown-item notify-item">
                        <img src="images/flags/spain.jpg" alt="user-image" class="mr-1" height="12"> <span
                            class="align-middle">Spanish</span>
                    </a>

                    <!-- item-->
                    <a href="javascript:void(0);" class="dropdown-item notify-item">
                        <img src="images/flags/germany.jpg" alt="user-image" class="mr-1" height="12"> <span
                            class="align-middle">German</span>
                    </a>

                    <!-- item-->
                    <a href="javascript:void(0);" class="dropdown-item notify-item">
                        <img src="images/flags/italy.jpg" alt="user-image" class="mr-1" height="12"> <span
                            class="align-middle">Italian</span>
                    </a>

                    <!-- item-->
                    <a href="javascript:void(0);" class="dropdown-item notify-item">
                        <img src="images/flags/russia.jpg" alt="user-image" class="mr-1" height="12"> <span
                            class="align-middle">Russian</span>
                    </a>

                </div>
            </li>

            <li class="dropdown notification-list">
                <a class="nav-link dropdown-toggle waves-effect waves-light" data-toggle="dropdown" href="#"
                   role="button" aria-haspopup="false" aria-expanded="false">
                    <i class="dripicons-inbox mail-icon"></i>
                    <span class="badge badge-info noti-icon-badge">20</span>
                </a>
                <div class="dropdown-menu dropdown-menu-right dropdown-lg">

                    <!-- item-->
                    <div class="dropdown-item noti-title">
                        <h5 class="m-0">
                                    <span class="float-right">
                                        <a href="" class="text-dark">
                                            <small>Clear All</small>
                                        </a>
                                    </span>20 New Messages
                        </h5>
                    </div>

                    <div class="slimscroll noti-scroll">

                        <!-- item-->
                        <a href="javascript:void(0);" class="dropdown-item notify-item active">
                            <div class="notify-icon"><img src="images/users/avatar-1.jpg"
                                                          class="img-fluid rounded-circle" alt=""/></div>
                            <p class="notify-details">Sandra Smith
                                <small class="text-muted">Hey ! I'm working on your project</small>
                            </p>
                        </a>

                        <!-- item-->
                        <a href="javascript:void(0);" class="dropdown-item notify-item">
                            <div class="notify-icon"><img src="images/users/avatar-2.jpg"
                                                          class="img-fluid rounded-circle" alt=""/></div>
                            <p class="notify-details">Amily Lee
                                <small class="text-muted">Hi, How are you? What about our next meeting?</small>
                            </p>
                        </a>

                        <!-- item-->
                        <a href="javascript:void(0);" class="dropdown-item notify-item">
                            <div class="notify-icon">
                                <img src="images/users/avatar-3.jpg" class="img-fluid rounded-circle" alt=""/></div>
                            <p class="notify-details">David Boos</p>
                            <p class="text-muted mb-0 user-msg">
                                <small>What about our next meeting</small>
                            </p>
                        </a>

                        <!-- item-->
                        <a href="javascript:void(0);" class="dropdown-item notify-item">
                            <div class="notify-icon"><img src="images/users/avatar-4.jpg"
                                                          class="img-fluid rounded-circle" alt=""/></div>
                            <p class="notify-details">Christopher Palmer
                                <small class="text-muted">Waiting for your Response...</small>
                            </p>
                        </a>

                        <!-- item-->
                        <a href="javascript:void(0);" class="dropdown-item notify-item">
                            <div class="notify-icon">
                                <img src="images/users/avatar-5.jpg" class="img-fluid rounded-circle" alt=""/></div>
                            <p class="notify-details">Malika Roy</p>
                            <p class="text-muted mb-0 user-msg">
                                <small>Wow that's great</small>
                            </p>
                        </a>
                    </div>

                    <!-- All-->
                    <a href="javascript:void(0);" class="dropdown-item text-center text-primary notify-item notify-all">
                        View all
                        <i class="fi-arrow-right"></i>
                    </a>

                </div>
            </li>

            <li class="dropdown notification-list">
                <a class="nav-link dropdown-toggle waves-effect waves-light" data-toggle="dropdown" href="#"
                   role="button" aria-haspopup="false" aria-expanded="false">
                    <i class="dripicons-bell noti-icon"></i>
                    <span class="badge badge-danger noti-icon-badge">35</span>
                </a>
                <div class="dropdown-menu dropdown-menu-right dropdown-lg">

                    <!-- item-->
                    <div class="dropdown-item noti-title">
                        <h5 class="m-0">
                                    <span class="float-right">
                                        <a href="" class="text-dark">
                                            <small>Clear All</small>
                                        </a>
                                    </span>Notification
                        </h5>
                    </div>

                    <div class="slimscroll noti-scroll">

                        <!-- item-->
                        <a href="javascript:void(0);" class="dropdown-item notify-item">
                            <div class="notify-icon bg-info"><i class="mdi mdi-cloud-upload-outline"></i></div>
                            <p class="notify-details">Your upload has been approved
                                <small class="text-muted">5 hours ago</small>
                            </p>
                        </a>

                        <!-- item-->
                        <a href="javascript:void(0);" class="dropdown-item notify-item active">
                            <div class="notify-icon bg-success"><i class="mdi mdi-map-marker-check"></i></div>
                            <p class="notify-details">You added your Location
                                <small class="text-muted">Just Now</small>
                            </p>
                        </a>

                        <!-- item-->
                        <a href="javascript:void(0);" class="dropdown-item notify-item">
                            <div class="notify-icon bg-primary"><i class="mdi mdi-layers-remove"></i></div>
                            <p class="notify-details">Your item is shipped
                                <small class="text-muted">It is a long established fact that a reader will</small>
                            </p>
                        </a>

                        <!-- item-->
                        <a href="javascript:void(0);" class="dropdown-item notify-item">
                            <div class="notify-icon bg-purple"><i class="mdi mdi-check-bold"></i></div>
                            <p class="notify-details">Your order is placed
                                <small class="text-muted">Dummy text of the printing and typesetting industry.</small>
                            </p>
                        </a>

                        <!-- item-->
                        <a href="javascript:void(0);" class="dropdown-item notify-item">
                            <div class="notify-icon bg-warning">
                                <i class="mdi mdi-alert-outline"></i>
                            </div>
                            <p class="notify-details">Your Subscription Expired
                                <small class="text-muted">1 days ago</small>
                            </p>
                        </a>

                        <!-- item-->
                        <a href="javascript:void(0);" class="dropdown-item notify-item">
                            <div class="notify-icon bg-danger">
                                <i class="mdi mdi-settings"></i>
                            </div>
                            <p class="notify-details"><b>Devid</b>, You changed your Settings
                                <small class="text-muted">5 days ago</small>
                            </p>
                        </a>
                    </div>

                    <!-- All-->
                    <a href="javascript:void(0);" class="dropdown-item text-center text-primary notify-item notify-all">
                        View all
                        <i class="fi-arrow-right"></i>
                    </a>

                </div>
            </li>

            <li class="dropdown notification-list">
                <a class="nav-link dropdown-toggle nav-user mr-0 waves-effect waves-light" data-toggle="dropdown"
                   href="#" role="button" aria-haspopup="false" aria-expanded="false">
                    <img src="images/users/avatar-1.jpg" alt="user-image" class="rounded-circle">
                    <span class="pro-user-name ml-1" id="name">
                                <i class="mdi mdi-chevron-down"></i>
                            </span>
                </a>
                <div class="dropdown-menu dropdown-menu-right profile-dropdown ">
                    <!-- item-->
                    <div class="dropdown-item noti-title">
                        <h6 class="m-0" id="name1">

                        </h6>
                    </div>

                    <!-- item-->
                    <a href="javascript:void(0);" class="dropdown-item notify-item">
                        <i class="dripicons-user"></i>
                        <span>我的信息</span>
                    </a>

                    <!-- item-->
                    <a href="javascript:void(0);" class="dropdown-item notify-item">
                        <i class="dripicons-card"></i>
                        <span>My Wallet</span>
                    </a>

                    <!-- item-->
                    <a href="javascript:void(0);" class="dropdown-item notify-item">
                        <i class="dripicons-gear"></i>
                        <span>设置信息</span>
                    </a>

                    <div class="dropdown-divider"></div>

                    <!-- item-->
                    <a href="javascript:void(0);" class="dropdown-item notify-item">
                        <i class="dripicons-power"></i>
                        <span onclick="tuichu(this)">退出登录</span>
                    </a>

                </div>
            </li>

        </ul>

        <ul class="list-unstyled menu-left mb-0">
            <li class="float-left">
                <a href="index.html" class="logo">
                            <span class="logo-lg">
                                <img src="assets/images/logo.png" alt="" height="35"></span>
                    <span class="logo-sm">
                                <img src="assets/images/logo.png" alt="" height="34">
                            </span>
                </a>
            </li>
            <li class="float-left">
                <a class="button-menu-mobile navbar-toggle">
                    <div class="lines">
                        <span></span>
                        <span></span>
                        <span></span>
                    </div>
                </a>
            </li>
            <li class="app-search d-none d-md-block">
                <form class="form-inline">
                    <input type="text" class="form-control" placeholder="请输入用户姓名" id="sousuo">
                    <button class="btn btn-primary-color" type="submit" onclick="sousuo1(this)"><i
                            class="fa fa-search"></i></button>
                </form>
            </li>
        </ul>
    </div>
    <!-- end Topbar -->

    <div class="left-side-menu">

        <div class="slimscroll-menu">

            <!--- Sidemenu -->
            <div id="sidebar-menu">

                <ul class="metismenu" id="side-menu">


                    <div class="left-user">
                        <div class="user-box">
                            <div class="user-img">
                                <img src="images/users/avatar-1.jpg" alt="user-img" title="Mat Helme"
                                     class="rounded-circle img-fluid">
                                <a href="javascript:void(0);" class="user-edit"><i class="mdi mdi-pencil"></i></a>
                            </div>

                            <h5><a href="javascript: void(0);">欢迎您</a></h5>
                            <p class="text-muted mb-0">
                                <small id="admin"></small>
                            </p>
                        </div>
                    </div>

                    <li>
                        <a href="index.html">
                            <i class="dripicons-device-desktop"></i>
                            <span>系统分析</span>
                        </a>
                    </li>

                    <li>
                        <a href="javascript: void(0);">
                            <i class="dripicons-view-apps"></i>
                            <span> 界面布局 </span>
                            <span class="menu-arrow"></span>
                        </a>
                        <ul class="nav-second-level" aria-expanded="false">
                            <li>
                                <a href="layouts-dark-header.html">深色标题</a>
                            </li>
                            <li>
                                <a href="layouts-sidebar-collapsed.html">搜索侧栏</a>
                            </li>
                            <li>
                                <a href="layouts-dark-sidebar.html">深色侧栏</a>
                            </li>
                            <li>
                                <a href="layouts-small-sidebar.html">小型侧栏</a>
                            </li>
                            <li>
                                <a href="layouts-boxed.html">方框布局</a>
                            </li>
                        </ul>
                    </li>

                    <li>
                        <a href="tables-datatable.html">
                            <i class="dripicons-calendar"></i> <span> 业主信息 </span><span class="menu-arrow"></span>
                        </a>
                    </li>
                    <li>
                        <a href="room-datatable.html">
                            <i class="dripicons-briefcase"></i>
                            <span> 住房信息 </span>
                            <span class="menu-arrow"></span>
                        </a>
                    </li>

                    <li>
                        <a href="javascript: void(0);">
                            <i class="dripicons-view-list"></i>
                            <span> 车辆信息 </span>
                            <span class="menu-arrow"></span>
                        </a>
                        <ul class="nav-second-level" aria-expanded="false">
                            <li>
                                <a href="car-datatable.html">基本信息</a>
                            </li>
                            <li>
                                <a href="travelrecord-datatable.html">出行记录</a>
                            </li>
                        </ul>
                    </li>
                    <li>
                        <a href="order-datatable.html">
                            <i class="dripicons-graph-pie"></i>
                            <span> 收费管理 </span>
                            <span class="menu-arrow"></span>
                        </a>
                    </li>

                    <li>
                        <a href="repair-datatable.html">
                            <i class="dripicons-document"></i>
                            <span> 维修管理 </span>
                            <span class="menu-arrow"></span>
                        </a>
                    </li>

                    <li>
                        <a href="customer-datatable.html">
                            <i class="dripicons-map"></i>
                            <span> 客服管理 </span>
                            <span class="menu-arrow"></span>
                        </a>
                    </li>

                    <li>
                        ______________________________________
                    </li>
                    <li>
                        <a href="xtYongUser-datatable.html">
                            <i class="dripicons-user"></i>
                            <span> 员工管理</span>
                            <span class="menu-arrow"></span>
                        </a>
                    </li>

                    <li>
                        <a href="flower-datatable.html">
                            <i class="dripicons-star"></i>
                            <span> 楼盘管理 </span>
                            <span class="menu-arrow"></span>
                        </a>
                    </li>

                    <li>
                        <a href="complaint-datatable.html">
                            <i class="dripicons-duplicate"></i>
                            <span>投诉管理 </span>
                            <span class="menu-arrow"></span>
                        </a>
                    </li>
                </ul>

            </div>
            <!-- End Sidebar -->

            <div class="clearfix"></div>

        </div>
        <!-- Sidebar -left -->

    </div>
    <!-- Left Sidebar End -->

    <!-- ============================================================== -->
    <!-- Start Page Content here -->
    <!-- ============================================================== -->

    <div class="content-page">
        <div class="content">

            <!-- Start Content-->
            <div class="container-fluid">

                <!-- start page title -->
                <div class="row">
                    <div class="col-12">
                        <div class="page-title-box">
                            <div class="page-title-right">
                                <ol class="breadcrumb m-0">
                                    <li class="breadcrumb-item"><a href="javascript: void(0);">住房信息</a></li>
                                    <li class="breadcrumb-item"><a href="javascript: void(0);">信息界面</a></li>
                                </ol>
                            </div>
                            <h4 class="page-title">住房信息</h4>
                        </div>
                    </div>
                </div>
                <!-- end page title -->

                <div class="row">
                    <div class="col-12">
                        <div class="card-box">
                            <h4 class="header-title">信息界面</h4>
                            <p class="sub-header">
                                请谨慎操作！！注意业主信息
                            </p>
                            <p>
                                <select id="selected">
                                    <option selected="selected">5</option>
                                    <option>10</option>
                                    <option>20</option>
                                </select>
                                <img src="assets/添加.jpg" height="25" id="btn1" width="25">
                                <img src="assets/首页.jpg" height="25" id="btn2" width="25">
                            </p>
                            <table id="datatable" class="table table-bordered dt-responsive nowrap">
                                <tr>
                                    <th>住房编号</th>
                                    <th>业主姓名</th>
                                    <th>业主性别</th>
                                    <th>身份证号</th>
                                    <th id="floorNumber">住房楼号</th>
                                    <th id="roomNumber">住房房间</th>
                                    <th>登记时间</th>
                                    <th>住房状态</th>
                                    <th>操作</th>
                                </tr>

                                <tbody id="sbody">

                                </tbody>
                            </table>
                        </div> <!-- end card-box -->
                    </div> <!-- end col -->
                </div> <!-- end row -->
            </div> <!-- container-fluid -->
        </div> <!-- content -->
        <!-- Footer Start -->
        <footer class="footer">
            <div id="eeeee">

            </div>
            <div class="container-fluid">
                <div class="row">
                    <div class="col-md-12 text-center">
                        2020 © Dashboard Theme By <a href="index.html">Forest</a>
                    </div>
                </div>
            </div>
        </footer>
        <!-- end Footer -->

    </div>

    <!-- ============================================================== -->
    <!-- End Page content -->
    <!-- ============================================================== -->
    <div id="pop" class="pop">
        <div class="title" id="title">
            <ul class="addUL">
                <li class="addLI">业主姓名：</li>
                <li><input type="text" name="yeZhuNames" id="yeZhuNames" placeholder="请输入业主姓名"/> <label
                        class="xrequired" id="requires_1"></label></li>
            </ul>
            <ul class="addUL">
                <li class="addLI">身份证号：</li>
                <li><input type="text" name="yeZhuSFZ" id="yeZhuSFZ" placeholder="请输入身份证号"/><label class="xrequired"
                                                                                                   id="requires_3"></label>
                </li>
            </ul>
            <ul class="addUL">
                <li class="addLI">住房楼号：</li>
                <li><select id="floorName">
                    <option value="请选择住房楼号" selected="selected">请选择住房楼号</option>

                </select><label class="xrequired" id="requires_2"></label></li>
                </li>
            </ul>
            <ul class="addUL">
                <li class="addLI">住房房间：</li>
                <li><select id="roomName">
                    <option value="请选择住房房间" selected="selected">请选择住房房间</option>
                </select><label class="xrequired" id="requires_4"></label></li>
            </ul>
            <ul class="addUL">
                <li class="addLI">住房状态：</li>
                <li><select id="roomState">
                    <option value="2" selected="selected">未入住</option>
                    <option value="1" selected="selected">已入住</option>
                </select><label class="xrequired" id="requires_5"></label></li>
            </ul>
            <!-- style=display:none-->
            <ul class="addUL" style=display:none>
                <li class="addLI">住房状态：</li>
                <li><input id="yeZhuID" type="text"/></li>
            </ul>
        </div>
        <div class="btn" id="btn-left" onclick="addRoom(this)">确定</div>
        <div class="btn" id="btn-right" onclick="cancel(this)">取消</div>
    </div>

    <div id="pop1" class="pop">
        <div class="title" id="title1">
            <ul class="addUL">
                <li class="addLI">业主姓名：</li>
                <li><input type="text" name="yeZhuNames" id="yeZhuNames1" disabled="disabled" placeholder="请输入业主姓名"/>
                    <label
                            class="xrequired" id="requires_6"></label></li>
            </ul>
            <ul class="addUL">
                <li class="addLI">身份证号：</li>
                <li><input type="text" disabled="disabled" name="yeZhuSFZ" id="yeZhuSFZ1" placeholder="请输入身份证号"/><label
                        class="xrequired"
                        id="requires_7"></label>
                </li>
            </ul>
            <ul class="addUL">
                <li class="addLI">住房楼号：</li>
                <li><select id="floorName1">
                    <!-- <option value="请选择住房楼号" selected="selected" >请选择住房楼号</option>-->

                </select><label class="xrequired" id="requires_8"></label></li>
                </li>
            </ul>
            <ul class="addUL">
                <li class="addLI">住房房间：</li>
                <li><select id="roomName1">
                    <!--<option value="请选择住房房间" selected="selected" >请选择住房房间</option>-->
                </select><label class="xrequired" id="requires_9"></label></li>
            </ul>
            <ul class="addUL">
                <li class="addLI">住房状态：</li>
                <li><select id="roomState1">
                    <option value="2" selected="selected">未入住</option>
                    <option value="1" selected="selected">已入住</option>
                </select><label class="xrequired" id="requires_10"></label></li>
            </ul>
            <!-- style=display:none-->
            <ul class="addUL" style=display:none>
                <li class="addLI">身份证：</li>
                <li><input id="roomNameID" type="text"/></li>
            </ul>
        </div>
        <div class="btn" id="btn-left1" onclick="updateAfter(this)">确定</div>
        <div class="btn" id="btn-right2" onclick="cancel1(this)">取消</div>
    </div>

</div>
<!-- END wrapper -->

<!-- Vendor js -->
<script src="js/vendor.min.js"></script>

<!-- datatable js -->
<script src="libs/datatables/jquery.dataTables.min.js"></script>
<script src="libs/datatables/dataTables.bootstrap4.min.js"></script>
<script src="libs/datatables/dataTables.responsive.min.js"></script>
<script src="libs/datatables/responsive.bootstrap4.min.js"></script>

<script src="libs/datatables/dataTables.buttons.min.js"></script>
<script src="libs/datatables/buttons.bootstrap4.min.js"></script>
<script src="libs/datatables/buttons.html5.min.js"></script>
<script src="libs/datatables/buttons.flash.min.js"></script>
<script src="libs/datatables/buttons.print.min.js"></script>

<script src="libs/datatables/dataTables.keyTable.min.js"></script>
<script src="libs/datatables/dataTables.select.min.js"></script>

<!-- Datatables init -->
<script src="js/pages/datatables.init.js"></script>

<!-- App js -->
<script src="js/app.min.js"></script>
<script src="js/pop.js"></script>
<div id="container"></div>
</body>

<script type="text/javascript">


    /*增加的检验*/
    var imgObjTrue3 = $("<img src='assets/true.jpg' height=\"22\" width=\"23\">");
    var imgObjFalse3 = $("<img src='assets/false.jpg' height=\"22\" width=\"23\">");
    //业主姓名验证
    var flas3 = false;
    $("#yeZhuNames").blur(function () {
        var nc = $("#yeZhuNames").val();
        var pattern = /^[\u4E00-\u9FA5]{2,6}$/;
        if (nc == null || nc == "") {
            $("#requires_1").empty();
            $("#requires_1").append(imgObjFalse3);
            $("#yeZhuNames").val("");
            flas3 = false;
        } else if (!pattern.test(nc)) {
            $("#requires_1").empty();
            $("#requires_1").append(imgObjFalse3);
            $("#yeZhuNames").val("");
            flas3 = false;
        } else {
            $("#requires_1").empty();
            $("#requires_1").append(imgObjTrue3);
            flas3 = true;
            return;
        }
    });
    //身份证验证
    var imgObjTrue4 = $("<img src='assets/true.jpg' height=\"22\" width=\"23\">");
    var imgObjFalse4 = $("<img src='assets/false.jpg' height=\"22\" width=\"23\">");
    var flas4 = false;
    $("#yeZhuSFZ").blur(function () {
        var sfz = $("#yeZhuSFZ").val(); //
        //判断是身份证正则表达式
        var aa = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;

        if (sfz == null || sfz == "") {
            $("#requires_3").empty();
            $("#requires_3").append(imgObjFalse4);
            $("#yeZhuSFZ").val("");
            flas4 = false;

        } else if (!aa.test(sfz) || sfz.length != 18) {
            $("#requires_3").empty();
            $("#requires_3").append(imgObjFalse4);
            $("#yeZhuSFZ").val("");
            flas4 = false;
        } else {
            $("#requires_3").empty();
            $("#requires_3").append(imgObjTrue4);
            findUsrCredit();
            flas4 = true;
            return;
        }

    });

    var imgObjTrue5 = $("<img src='assets/true.jpg' height=\"22\" width=\"23\">");
    var imgObjFalse5 = $("<img src='assets/false.jpg' height=\"22\" width=\"23\">");
    //住房楼号
    var flas5 = false;
    $("#floorName").blur(function () {
        var sex = $("#floorName").val(); //
        if (sex == null || sex == "") {
            $("#requires_2").empty();
            $("#requires_2").append(imgObjFalse5);
            flas5 = false;
        } else {
            $("#requires_2").empty();
            $("#requires_2").append(imgObjTrue5);
            flas5 = true;
            return;
        }
    });

    var imgObjTrue = $("<img src='assets/true.jpg' height=\"22\" width=\"23\">");
    var imgObjFalse = $("<img src='assets/false.jpg' height=\"22\" width=\"23\">");
    //住房房间
    var flas = false;
    $("#roomName").blur(function () {
        var sex = $("#roomName").val(); //
        if (sex == null || sex == "") {
            $("#requires_4").empty();
            $("#requires_4").append(imgObjFalse);
            flas = false;
        } else {
            $("#requires_4").empty();
            $("#requires_4").append(imgObjTrue);
            flas = true;
            return;
        }
    });
    var imgObjTrue1 = $("<img src='assets/true.jpg' height=\"22\" width=\"23\">");
    var imgObjFalse1 = $("<img src='assets/false.jpg' height=\"22\" width=\"23\">");
    //住房状态
    var flas1 = false;
    $("#roomState").blur(function () {
        var sex = $("#roomState").val();
        if (sex == null || sex == "") {
            $("#requires_5").empty();
            $("#requires_5").append(imgObjFalse1);
            flas1 = false;
        } else {
            $("#requires_5").empty();
            $("#requires_5").append(imgObjTrue1);
            flas1 = true;
            return;
        }
    });


    /*修改的检验*/
    var imgObjTrue31 = $("<img src='assets/true.jpg' height=\"22\" width=\"23\">");
    var imgObjFalse31 = $("<img src='assets/false.jpg' height=\"22\" width=\"23\">");
    //业主姓名验证
    var flas31 = false;
    $("#yeZhuNames1").blur(function () {
        var nc = $("#yeZhuNames1").val();
        var pattern = /^[\u4E00-\u9FA5]{2,6}$/;
        if (nc == null || nc == "") {
            $("#requires_6").empty();
            $("#requires_6").append(imgObjFalse31);
            $("#yeZhuNames1").val("");
            flas31 = false;
        } else if (!pattern.test(nc)) {
            $("#requires_6").empty();
            $("#requires_6").append(imgObjFalse31);
            $("#yeZhuNames1").val("");
            flas31 = false;
        } else {
            $("#requires_6").empty();
            $("#requires_6").append(imgObjTrue31);
            flas31 = true;
            return;
        }
    });
    //身份证验证
    var imgObjTrue41 = $("<img src='assets/true.jpg' height=\"22\" width=\"23\">");
    var imgObjFalse41 = $("<img src='assets/false.jpg' height=\"22\" width=\"23\">");
    var flas41 = false;
    $("#yeZhuSFZ1").blur(function () {
        var sfz = $("#yeZhuSFZ1").val(); //
        //判断是身份证正则表达式
        var aa = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;

        if (sfz == null || sfz == "") {
            $("#requires_7").empty();
            $("#requires_7").append(imgObjFalse41);
            $("#yeZhuSFZ1").val("");
            flas41 = false;

        } else if (!aa.test(sfz) || sfz.length != 18) {
            $("#requires_7").empty();
            $("#requires_7").append(imgObjFalse41);
            $("#yeZhuSFZ1").val("");
            flas41 = false;
        } else {
            $("#requires_7").empty();
            $("#requires_7").append(imgObjTrue41);
            flas41 = true;
            return;
        }

    });

    var imgObjTrue51 = $("<img src='assets/true.jpg' height=\"22\" width=\"23\">");
    var imgObjFalse51 = $("<img src='assets/false.jpg' height=\"22\" width=\"23\">");
    //性别验证
    var flas51 = false;
    $("#floorName1").blur(function () {
        var sex = $("#floorName1").val();
        if (sex == null || sex == "") {
            $("#requires_8").empty();
            $("#requires_8").append(imgObjFalse51);
            flas51 = false;
        } else {
            $("#requires_8").empty();
            $("#requires_8").append(imgObjTrue51);
            flas51 = true;
            return;
        }
    });

    var imgObjTrue61 = $("<img src='assets/true.jpg' height=\"22\" width=\"23\">");
    var imgObjFalse61 = $("<img src='assets/false.jpg' height=\"22\" width=\"23\">");
    //住房房间
    var flas61 = false;
    $("#roomName1").blur(function () {
        var sex = $("#roomName1").val(); //
        if (sex == null || sex == "") {
            $("#requires_9").empty();
            $("#requires_9").append(imgObjFalse61);
            flas61 = false;
        } else {
            $("#requires_9").empty();
            $("#requires_9").append(imgObjTrue61);
            flas61 = true;
            return;
        }
    });

    var imgObjTrue10 = $("<img src='assets/true.jpg' height=\"22\" width=\"23\">");
    var imgObjFalse10 = $("<img src='assets/false.jpg' height=\"22\" width=\"23\">");
    //住房状态
    var flas10 = false;
    $("#roomState1").blur(function () {
        var sex = $("#roomState1").val();
        if (sex == null || sex == "") {
            $("#requires_10").empty();
            $("#requires_10").append(imgObjFalse10);
            flas10 = false;
        } else {
            $("#requires_10").empty();
            $("#requires_10").append(imgObjTrue10);
            flas10 = true;
            return;
        }
    });

    //加载业主信息
    function loadstu() {
        var data = {
            "size": $("#selected").val(),
            "num": 0
        };
        $.ajax({
            url: "floorSelect",
            type: "POST",
            dataType: "json",
            contentType: 'application/json;charset=utf-8',
            data: JSON.stringify(data),
            success: function (data) {
                if (data.code == 500) {
                    window.location.href = userUrl + "/pages-login.html";
                } else {
                    var str1 = null;
                    for (var i = 0; i < data.num; i++) {
                        str1 += "<input type='button' value=" + (i + 1) + " onclick='dos(" + i + ",this)'>";
                    }
                    var str = null;
                    for (var i = 0; i < data.user.length; i++) {
                        if (data.user[i].roomState == 2) {
                            var roomState = "未入住";
                        } else if (data.user[i].roomState == 1) {
                            var roomState = "已入住";
                        }
                        str += "<tr>";
                        str += "<td>" + (i + 1) + "</td>";
                        str += "<td>" + data.user[i].message.yeZhuName + "</td>";
                        str += "<td>" + data.user[i].message.yeZhuSex + "</td>";
                        str += "<td>" + data.user[i].message.yeZhuSFZ + "</td>";
                        str += "<td>" + data.user[i].floor.floorName + "</td>";
                        str += "<td>" + data.user[i].room.roomName + "</td>";
                        str += "<td>" + data.user[i].roomNameDate + "</td>";
                        str += "<td>" + roomState + "</td>";
                        str += "<td class=\"text-center\"><a href=\"javascript:void(0);\"  onclick='updates(" + data.user[i].roomNameID + ",this)' class=\"badge-info btn-sm mg-y-5\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"\" data-original-title=\"Edit\"><i class=\"mdi mdi-square-edit-outline\"></i></a><a href=\"javascript:void(0);\" onclick='shanchu(" + data.user[i].roomNameID + ",this)' class=\"badge-danger btn-sm mg-y-5\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"\" data-original-title=\"Delete\"><i class=\"mdi mdi-trash-can\"></i></a></td>";
                        str += "</tr>";
                    }
                }
                $("#sbody").empty();
                $("#sbody").append(str);
                $("#eeeee").html(str1);
                $("#name").html(data.name);
                $("#name1").html(data.name);
                $("#admin").html(data.name);
            }
        });
    }

    //分页查询
    function dos(id) {
        var data = {
            "size": $("#selected").val(),
            "num": id
        };
        $.ajax({
            url: "floorSelectFenYe",
            type: "POST",
            dataType: "json",
            contentType: 'application/json;charset=utf-8',
            data: JSON.stringify(data),
            success: function (data) {
                if (data.code == 500) {
                    window.location.href = userUrl + "/pages-login.html";
                } else {
                    var str1 = null;
                    for (var i = 0; i < data.num; i++) {
                        str1 += "<input type='button' value=" + (i + 1) + " onclick='dos(" + i + ",this)'>";
                    }
                    var str = null;
                    for (var i = 0; i < data.user.length; i++) {
                        if (data.user[i].roomState == 2) {
                            var roomState = "未入住";
                        } else if (data.user[i].roomState == 1) {
                            var roomState = "已入住";
                        }
                        str += "<tr>";
                        str += "<td>" + (i + 1) + "</td>";
                        str += "<td>" + data.user[i].message.yeZhuName + "</td>";
                        str += "<td>" + data.user[i].message.yeZhuSex + "</td>";
                        str += "<td>" + data.user[i].message.yeZhuSFZ + "</td>";
                        str += "<td>" + data.user[i].floor.floorName + "</td>";
                        str += "<td>" + data.user[i].room.roomName + "</td>";
                        str += "<td>" + data.user[i].roomNameDate + "</td>";
                        str += "<td>" + roomState + "</td>";
                        str += "<td class=\"text-center\"><a href=\"javascript:void(0);\"  onclick='updates(" + data.user[i].roomNameID + ",this)' class=\"badge-info btn-sm mg-y-5\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"\" data-original-title=\"Edit\"><i class=\"mdi mdi-square-edit-outline\"></i></a><a href=\"javascript:void(0);\" onclick='shanchu(" + data.user[i].roomNameID + ",this)' class=\"badge-danger btn-sm mg-y-5\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"\" data-original-title=\"Delete\"><i class=\"mdi mdi-trash-can\"></i></a></td>";
                        str += "</tr>";
                    }
                }
                $("#sbody").empty();
                $("#sbody").append(str);
                $("#eeeee").html(str1);
                $("#name").html(data.name);
                $("#name1").html(data.name);
            }
        });
    }

    //删除业主
    function shanchu(roomNameID, ob) {
        swal.fire({
            type: 'warning', // 弹框类型
            title: '警告', //标题
            text: "请确认是否删除该信息", //显示内容
            confirmButtonColor: '#3085d6',// 确定按钮的 颜色
            confirmButtonText: '确定',// 确定按钮的 文字
            showCancelButton: true, // 是否显示取消按钮
            cancelButtonColor: '#d33', // 取消按钮的 颜色
            cancelButtonText: "取消", // 取消按钮的 文字
            focusCancel: true, // 是否聚焦 取消按钮
            reverseButtons: true  // 是否 反转 两个按钮的位置 默认是  左边 确定  右边 取消
        }).then(function (isConfirm) {
            if (isConfirm.value) {
                // Swal.fire("成功", "点击了确定", "success");
                $.ajax({
                    url: "floorDelete",
                    type: "POST",
                    data: {"roomNameID": roomNameID},
                    dataType: "json",
                    traditional: true,
                    success: function (data) {
                        if (data.code == 200) {
                            Swal.fire("提示", "删除成功", "success");
                            // 删除要删除数据所在的标签
                            $(ob).parents("tr").remove();
                        } else {
                            Swal.fire("提示", "不存在该数据", "error");
                        }
                        loadstu();
                    }
                });
            } else {
                Swal.fire("取消", "删除取消", "error");
            }
        })
    }

    //当更改数据时
    $("#selected").blur(function () {
        loadstu();
    });

    //新增之前
    $("#btn1").click(function () {
        //业主
        $("#yeZhuNames").val("");
        //身份证
        $("#yeZhuSFZ").val("");
        $.ajax({
            url: "floorSelectAgo",
            type: "POST",
            data: {"code": 200},
            dataType: "json",
            traditional: true,
            success: function (data) {
                if (data.code == 200) {
                    var str;
                    for (var i = 0; i < data.floor.length; i++) {
                        str += " <option value=" + data.floor[i].floorID + " >" + data.floor[i].floorName + "</option>";
                    }
                    var str2;
                    for (var i = 0; i < data.room.length; i++) {
                        str2 += " <option value=" + data.room[i].roomID + " >" + data.room[i].roomName + "</option>";
                    }
                } else {
                    Swal.fire("提示", "不存在该数据", "error");
                }
                $("#floorName").empty();
                $("#roomName").empty();
                $("#floorName").append(str);
                $("#roomName").append(str2);
            }
        });
        openPop("#container", "#pop", 400, 600);
    });

    //排序(按楼号)
    $("#floorNumber").click(function () {
        var data = {
            "size": $("#selected").val(),
            "num": 0
        };
        $.ajax({
            url: "floorSelectEmploy",
            type: "POST",
            dataType: "json",
            contentType: 'application/json;charset=utf-8',
            data: JSON.stringify(data),
            success: function (data) {
                if (data.code == 500) {
                    window.location.href = userUrl + "/pages-login.html";
                } else {
                    var str1 = null;
                    for (var i = 0; i < data.num; i++) {
                        str1 += "<input type='button' value=" + (i + 1) + " onclick='floorSelect(" + i + ",this)'>";
                    }
                    var str = null;
                    for (var i = 0; i < data.user.length; i++) {
                        if (data.user[i].roomState == 2) {
                            var roomState = "未入住";
                        } else if (data.user[i].roomState == 1) {
                            var roomState = "已入住";
                        }
                        str += "<tr>";
                        str += "<td>" + (i + 1) + "</td>";
                        str += "<td>" + data.user[i].message.yeZhuName + "</td>";
                        str += "<td>" + data.user[i].message.yeZhuSex + "</td>";
                        str += "<td>" + data.user[i].message.yeZhuSFZ + "</td>";
                        str += "<td>" + data.user[i].floor.floorName + "</td>";
                        str += "<td>" + data.user[i].room.roomName + "</td>";
                        str += "<td>" + data.user[i].roomNameDate + "</td>";
                        str += "<td>" + roomState + "</td>";
                        str += "<td class=\"text-center\"><a href=\"javascript:void(0);\"  onclick='updates(" + data.user[i].roomNameID + ",this)' class=\"badge-info btn-sm mg-y-5\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"\" data-original-title=\"Edit\"><i class=\"mdi mdi-square-edit-outline\"></i></a><a href=\"javascript:void(0);\" onclick='shanchu(" + data.user[i].roomNameID + ",this)' class=\"badge-danger btn-sm mg-y-5\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"\" data-original-title=\"Delete\"><i class=\"mdi mdi-trash-can\"></i></a></td>";
                        str += "</tr>";
                    }
                }
                $("#sbody").empty();
                $("#sbody").append(str);
                $("#eeeee").html(str1);
                $("#name").html(data.name);
                $("#name1").html(data.name);
            }
        });
    });

    function floorSelect(id) {
        var data = {
            "size": $("#selected").val(),
            "num": id
        };
        $.ajax({
            url: "floorSelectEmploy",
            type: "POST",
            dataType: "json",
            contentType: 'application/json;charset=utf-8',
            data: JSON.stringify(data),
            success: function (data) {
                if (data.code == 500) {
                    window.location.href = userUrl + "/pages-login.html";
                } else {
                    var str1 = null;
                    for (var i = 0; i < data.num; i++) {
                        str1 += "<input type='button' value=" + (i + 1) + " onclick='floorSelect(" + i + ",this)'>";
                    }
                    var str = null;
                    for (var i = 0; i < data.user.length; i++) {
                        if (data.user[i].roomState == 2) {
                            var roomState = "未入住";
                        } else if (data.user[i].roomState == 1) {
                            var roomState = "已入住";
                        }
                        str += "<tr>";
                        str += "<td>" + (i + 1) + "</td>";
                        str += "<td>" + data.user[i].message.yeZhuName + "</td>";
                        str += "<td>" + data.user[i].message.yeZhuSex + "</td>";
                        str += "<td>" + data.user[i].message.yeZhuSFZ + "</td>";
                        str += "<td>" + data.user[i].floor.floorName + "</td>";
                        str += "<td>" + data.user[i].room.roomName + "</td>";
                        str += "<td>" + data.user[i].roomNameDate + "</td>";
                        str += "<td>" + roomState + "</td>";
                        str += "<td class=\"text-center\"><a href=\"javascript:void(0);\"  onclick='updates(" + data.user[i].roomNameID + ",this)' class=\"badge-info btn-sm mg-y-5\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"\" data-original-title=\"Edit\"><i class=\"mdi mdi-square-edit-outline\"></i></a><a href=\"javascript:void(0);\" onclick='shanchu(" + data.user[i].roomNameID + ",this)' class=\"badge-danger btn-sm mg-y-5\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"\" data-original-title=\"Delete\"><i class=\"mdi mdi-trash-can\"></i></a></td>";
                        str += "</tr>";
                    }
                }
                $("#sbody").empty();
                $("#sbody").append(str);
                $("#eeeee").html(str1);
                $("#name").html(data.name);
                $("#name1").html(data.name);
            }
        });
    }


    //排序(按房间号)
    $("#roomNumber").click(function () {
        var data = {
            "size": $("#selected").val(),
            "num": 0
        };
        $.ajax({
            url: "floorSelectRoom",
            type: "POST",
            dataType: "json",
            contentType: 'application/json;charset=utf-8',
            data: JSON.stringify(data),
            success: function (data) {
                if (data.code == 500) {
                    window.location.href = userUrl + "/pages-login.html";
                } else {
                    var str1 = null;
                    for (var i = 0; i < data.num; i++) {
                        str1 += "<input type='button' value=" + (i + 1) + " onclick='floorSelectRoom(" + i + ",this)'>";
                    }
                    var str = null;
                    for (var i = 0; i < data.user.length; i++) {
                        if (data.user[i].roomState == 2) {
                            var roomState = "未入住";
                        } else if (data.user[i].roomState == 1) {
                            var roomState = "已入住";
                        }
                        str += "<tr>";
                        str += "<td>" + (i + 1) + "</td>";
                        str += "<td>" + data.user[i].message.yeZhuName + "</td>";
                        str += "<td>" + data.user[i].message.yeZhuSex + "</td>";
                        str += "<td>" + data.user[i].message.yeZhuSFZ + "</td>";
                        str += "<td>" + data.user[i].floor.floorName + "</td>";
                        str += "<td>" + data.user[i].room.roomName + "</td>";
                        str += "<td>" + data.user[i].roomNameDate + "</td>";
                        str += "<td>" + roomState + "</td>";
                        str += "<td class=\"text-center\"><a href=\"javascript:void(0);\"  onclick='updates(" + data.user[i].roomNameID + ",this)' class=\"badge-info btn-sm mg-y-5\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"\" data-original-title=\"Edit\"><i class=\"mdi mdi-square-edit-outline\"></i></a><a href=\"javascript:void(0);\" onclick='shanchu(" + data.user[i].roomNameID + ",this)' class=\"badge-danger btn-sm mg-y-5\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"\" data-original-title=\"Delete\"><i class=\"mdi mdi-trash-can\"></i></a></td>";
                        str += "</tr>";
                    }
                }
                $("#sbody").empty();
                $("#sbody").append(str);
                $("#eeeee").html(str1);
                $("#name").html(data.name);
                $("#name1").html(data.name);
            }
        });
    });

    function floorSelectRoom(id) {
        var data = {
            "size": $("#selected").val(),
            "num": id
        };
        $.ajax({
            url: "floorSelectRoom",
            type: "POST",
            dataType: "json",
            contentType: 'application/json;charset=utf-8',
            data: JSON.stringify(data),
            success: function (data) {
                if (data.code == 500) {
                    window.location.href = userUrl + "/pages-login.html";
                } else {
                    var str1 = null;
                    for (var i = 0; i < data.num; i++) {
                        str1 += "<input type='button' value=" + (i + 1) + " onclick='floorSelect(" + i + ",this)'>";
                    }
                    var str = null;
                    for (var i = 0; i < data.user.length; i++) {
                        if (data.user[i].roomState == 2) {
                            var roomState = "未入住";
                        } else if (data.user[i].roomState == 1) {
                            var roomState = "已入住";
                        }
                        str += "<tr>";
                        str += "<td>" + (i + 1) + "</td>";
                        str += "<td>" + data.user[i].message.yeZhuName + "</td>";
                        str += "<td>" + data.user[i].message.yeZhuSex + "</td>";
                        str += "<td>" + data.user[i].message.yeZhuSFZ + "</td>";
                        str += "<td>" + data.user[i].floor.floorName + "</td>";
                        str += "<td>" + data.user[i].room.roomName + "</td>";
                        str += "<td>" + data.user[i].roomNameDate + "</td>";
                        str += "<td>" + roomState + "</td>";
                        str += "<td class=\"text-center\"><a href=\"javascript:void(0);\"  onclick='updates(" + data.user[i].roomNameID + ",this)' class=\"badge-info btn-sm mg-y-5\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"\" data-original-title=\"Edit\"><i class=\"mdi mdi-square-edit-outline\"></i></a><a href=\"javascript:void(0);\" onclick='shanchu(" + data.user[i].roomNameID + ",this)' class=\"badge-danger btn-sm mg-y-5\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"\" data-original-title=\"Delete\"><i class=\"mdi mdi-trash-can\"></i></a></td>";
                        str += "</tr>";
                    }
                }
                $("#sbody").empty();
                $("#sbody").append(str);
                $("#eeeee").html(str1);
                $("#name").html(data.name);
                $("#name1").html(data.name);
            }
        });
    }

    //首页
    $("#btn2").click(function () {
        loadstu();
    });

    //新增业主信息
    function addRoom() {
        var floorName = $("#floorName").val();
        var roomName = $("#roomName").val();
        var yeZhuID = $("#yeZhuID").val();
        var roomState = $("#roomState").val();
        var yeZhuSFZ = $("#yeZhuSFZ").val();
        swal.fire({
            type: 'warning', // 弹框类型
            title: '提示', //标题
            text: "请确认是否确认登记", //显示内容
            confirmButtonColor: '#3085d6',// 确定按钮的 颜色
            confirmButtonText: '确定',// 确定按钮的 文字
            showCancelButton: true, // 是否显示取消按钮
            cancelButtonColor: '#d33', // 取消按钮的 颜色
            cancelButtonText: "取消", // 取消按钮的 文字
            focusCancel: true, // 是否聚焦 取消按钮
            reverseButtons: true  // 是否 反转 两个按钮的位置 默认是  左边 确定  右边 取消
        }).then(function (isConfirm) {
            if (isConfirm.value) {
                var data = {
                    "floorID": floorName,
                    "roomID": roomName,
                    "roomState": roomState,
                    "yeZhuID": yeZhuID
                };
                if (flas3 == true && flas4 == true && yeZhuSFZ != "") {
                    $.ajax({
                        url: "floorInsert",
                        type: "POST",
                        dataType: "json",
                        contentType: 'application/json;charset=utf-8',
                        data: JSON.stringify(data),
                        async: true,
                        success: function (data) {
                            if (data.code == 200) {
                                Swal.fire("提示", "登记成功", "success");
                                $("#container").hide();
                                $("#pop").hide();
                                loadstu();
                            } else if (data.code == 400) {
                                Swal.fire("警告", "房间已被注册", "question");
                            } else {
                                Swal.fire("错误", "登记失败", "error");
                            }
                        }
                    });
                } else {
                    Swal.fire("提示", "输入数据有误", "question");
                }
            } else {
                Swal.fire("取消", "取消登记", "error");
            }
        })
    }

    //获取系统用户的身份证
    function findUsrCredit() {
        var yeZhuSFZ = $("#yeZhuSFZ").val();        //身份证号
        $.ajax({
            url: "yeZhuFindUserCredit",
            type: "POST",
            data: {"yeZhuSFZ": yeZhuSFZ},
            dataType: "json",
            traditional: true,
            success: function (data) {
                if (data.code == 200) {
                    Swal.fire("提示", "身份证号输入有误", "warning")
                } else {
                    $("#yeZhuID").val(data.yeZhuID);
                    $("#requires_3").empty();
                    $("#requires_3").append(imgObjTrue4);
                }
            }
        });
    }

    //增加取消
    function cancel() {
        $("#container").hide();
        $("#pop").hide();
    }

    //修改取消
    function cancel1() {
        $("#container").hide();
        $("#pop1").hide();
    }

    //修改之前
    function updates(roomNameID) {
        $.ajax({
            url: "floorSelectUpdate",
            type: "POST",
            data: {"roomNameID": roomNameID},
            dataType: "json",
            traditional: true,
            success: function (data) {
                if (data.code == 200) {
                    var str;
                    for (var i = 0; i < data.floorList.length; i++) {
                        str += " <option value=" + data.floorList[i].floorID + " >" + data.floorList[i].floorName + "</option>";
                    }
                    var str2;
                    for (var i = 0; i < data.roomList.length; i++) {
                        str2 += " <option value=" + data.roomList[i].roomID + " >" + data.roomList[i].roomName + "</option>";
                    }
                    $("#yeZhuNames1").val(data.list.message.yeZhuName);
                    $("#yeZhuSFZ1").val(data.list.message.yeZhuSFZ);
                    $("#floorName1").empty();
                    $("#roomName1").empty();
                    $("#floorName1").append(str);
                    $("#roomName1").append(str2);
                    $("#roomState1").val(data.list.roomState);
                    $("#roomName1").val(data.list.roomID);
                    $("#floorName1").val(data.list.floorID);
                    $("#roomNameID").val(data.list.roomNameID);
                    openPop("#container", "#pop1", 400, 600);
                } else {
                    Swal.fire("提示", "不存在该数据", "error");
                }
            }
        })
    }

    //修改住房信息
    function updateAfter() {
        var floorName = $("#floorName1").val();
        var roomName = $("#roomName1").val();
        var yeZhuID = $("#yeZhuID1").val();
        var roomState = $("#roomState1").val();
        var roomNameID = $("#roomNameID").val();
        swal.fire({
            type: 'warning', // 弹框类型
            title: '提示', //标题
            text: "请确认是否确认编辑", //显示内容
            confirmButtonColor: '#3085d6',// 确定按钮的 颜色
            confirmButtonText: '确定',// 确定按钮的 文字
            showCancelButton: true, // 是否显示取消按钮
            cancelButtonColor: '#d33', // 取消按钮的 颜色
            cancelButtonText: "取消", // 取消按钮的 文字
            focusCancel: true, // 是否聚焦 取消按钮
            reverseButtons: true  // 是否 反转 两个按钮的位置 默认是  左边 确定  右边 取消
        }).then(function (isConfirm) {
            if (isConfirm.value) {
                var data = {
                    "floorID": floorName,
                    "roomID": roomName,
                    "roomState": roomState,
                    "yeZhuID": roomNameID,
                    "roomNameID": roomNameID
                };
                $.ajax({
                    url: "floorUpdateAfter",
                    type: "POST",
                    dataType: "json",
                    contentType: 'application/json;charset=utf-8',
                    data: JSON.stringify(data),
                    async: true,
                    success: function (data) {
                        if (data.code == 200) {
                            Swal.fire("提示", "登记成功", "success");
                            $("#container").hide();
                            $("#pop1").hide();
                            loadstu();
                        } else if (data.code == 400) {
                            Swal.fire("警告", "房间已被占用", "question");
                        } else {
                            Swal.fire("错误", "登记失败", "error");
                        }
                    }
                });
            } else {
                Swal.fire("取消", "取消登记", "error");
            }
        })
    }

    //搜索
    function sousuo1() {
        var data = {
            "name": $("#sousuo").val(),
            "size": $("#selected").val(),
            "num": 0
        };
        $.ajax({
            url: "floorSelectByPrimaryKeysName",
            type: "POST",
            dataType: "json",
            contentType: 'application/json;charset=utf-8',
            data: JSON.stringify(data),
            success: function (data) {
                if (data.code == 500) {
                    window.location.href = userUrl + "/pages-login.html";
                } else {
                    var str1 = null;
                    for (var i = 0; i < data.num; i++) {
                        str1 += "<input type='button' value=" + (i + 1) + " onclick='sousuo(" + i + ",this)'>";
                    }
                    var str = null;
                    for (var i = 0; i < data.user.length; i++) {
                        if (data.user[i].roomState == 2) {
                            var roomState = "未入住";
                        } else if (data.user[i].roomState == 1) {
                            var roomState = "已入住";
                        }
                        str += "<tr>";
                        str += "<td>" + (i + 1) + "</td>";
                        str += "<td>" + data.user[i].message.yeZhuName + "</td>";
                        str += "<td>" + data.user[i].message.yeZhuSex + "</td>";
                        str += "<td>" + data.user[i].message.yeZhuSFZ + "</td>";
                        str += "<td>" + data.user[i].floor.floorName + "</td>";
                        str += "<td>" + data.user[i].room.roomName + "</td>";
                        str += "<td>" + data.user[i].roomNameDate + "</td>";
                        str += "<td>" + roomState + "</td>";
                        str += "<td class=\"text-center\"><a href=\"javascript:void(0);\"  onclick='updates(" + data.user[i].roomNameID + ",this)' class=\"badge-info btn-sm mg-y-5\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"\" data-original-title=\"Edit\"><i class=\"mdi mdi-square-edit-outline\"></i></a><a href=\"javascript:void(0);\" onclick='shanchu(" + data.user[i].roomNameID + ",this)' class=\"badge-danger btn-sm mg-y-5\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"\" data-original-title=\"Delete\"><i class=\"mdi mdi-trash-can\"></i></a></td>";
                        str += "</tr>";
                    }
                }
                $("#sbody").empty();
                $("#sbody").append(str);
                $("#eeeee").html(str1);
                $("#name").html(data.name);
                $("#name1").html(data.name);
            }
        });
    }

    //加载业主信息 1
    $("#sousuo").blur(function () {
        sousuo1();
    });

    //退出
    function tuichu() {
        $.ajax({
            url: "tuiChu",
            type: "POST",
            dataType: "json",
            contentType: 'application/json;charset=utf-8',
            success: function (data) {
                window.location.href = userUrl + "/pages-login.html";
            }
        });
    }

    //分页查询 1
    function sousuo(id) {
        var data = {
            "name": $("#sousuo").val(),
            "size": $("#selected").val(),
            "num": id
        };
        $.ajax({
            url: "floorSelectByPrimaryKeysName",
            type: "POST",
            dataType: "json",
            contentType: 'application/json;charset=utf-8',
            data: JSON.stringify(data),
            success: function (data) {
                if (data.code == 500) {
                    window.location.href = userUrl + "/pages-login.html";
                } else {
                    var str1 = null;
                    for (var i = 0; i < data.num; i++) {
                        str1 += "<input type='button' value=" + (i + 1) + " onclick='sousuo(" + i + ",this)'>";
                    }
                    var str = null;
                    for (var i = 0; i < data.user.length; i++) {
                        if (data.user[i].roomState == 2) {
                            var roomState = "未入住";
                        } else if (data.user[i].roomState == 1) {
                            var roomState = "已入住";
                        }
                        str += "<tr>";
                        str += "<td>" + (i + 1) + "</td>";
                        str += "<td>" + data.user[i].message.yeZhuName + "</td>";
                        str += "<td>" + data.user[i].message.yeZhuSex + "</td>";
                        str += "<td>" + data.user[i].message.yeZhuSFZ + "</td>";
                        str += "<td>" + data.user[i].floor.floorName + "</td>";
                        str += "<td>" + data.user[i].room.roomName + "</td>";
                        str += "<td>" + data.user[i].roomNameDate + "</td>";
                        str += "<td>" + roomState + "</td>";
                        str += "<td class=\"text-center\"><a href=\"javascript:void(0);\"  onclick='updates(" + data.user[i].roomNameID + ",this)' class=\"badge-info btn-sm mg-y-5\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"\" data-original-title=\"Edit\"><i class=\"mdi mdi-square-edit-outline\"></i></a><a href=\"javascript:void(0);\" onclick='shanchu(" + data.user[i].roomNameID + ",this)' class=\"badge-danger btn-sm mg-y-5\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"\" data-original-title=\"Delete\"><i class=\"mdi mdi-trash-can\"></i></a></td>";
                        str += "</tr>";
                    }
                }
                $("#sbody").empty();
                $("#sbody").append(str);
                $("#eeeee").html(str1);
                $("#name").html(data.name);
                $("#name1").html(data.name);
            }
        });
    }

    $(function () {
        //调用加载数据函数
        loadstu();
        $("tbody tr:nth-child(odd)").css("background", "#CCF");    //奇偶行变色
    });
</script>
</html>